package com.bwie.controller;

import com.bwie.pojo.TbItem;
import com.bwie.service.TbItemService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/item/item")
public class TbItemController {

    @Autowired
    TbItemService tbItemService;

    @PostMapping("/pageTbItemList")
    public R pageTbItemList(@RequestBody PageInfoVo pageInfoVo) {
        return tbItemService.pageTbItemList(pageInfoVo);
    }
    @PostMapping("/saveTbItem")
    public R saveTbItem(@RequestBody TbItem tbItem) {
        return tbItemService.saveTbItem(tbItem);
    }
    @PostMapping("/OssUpload")
    public R OssUpload(@RequestBody MultipartFile file) throws IOException {
        return tbItemService.OssUpload(file);
    }
    @PostMapping("/TbRegionList")
    public R TbRegionList() {
        return tbItemService.TbRegionList();
    }
}
